package com.dongzhu1428.express.module1;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

@SuperBuilder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
@Data
public class Result<T> {
	/**
	 * 状态代码
	 * @mock 1111
	 */
	String code;
	/**
	 * 信息
	 * @mock 成功
	 */
	String msg;
	/**
	 * 接口数据
	 * @mock 接口数据
	 */
	T data;

	public  Result(T data){
		this.code = "1111";
		this.msg = "成功";
		this.data = data;
	}

	public  Result(T data,String msg){
		this.code = "1111";
		this.msg = msg;
		this.data = data;
	}
public static <T> Result success(T data){
		return  new Result(data);
	}

	public static <T> Result success(T data,String msg){
		return  new Result(data,msg);
	}
}
